load("@rules_java//java:defs.bzl", "java_library")
load("@rules_jvm_external//:defs.bzl", "artifact")

java_library(
    name = "core",
    visibility = ["//visibility:public"],
    exports = ["//api"],
)

java_library(
    name = "inprocess",
    visibility = ["//visibility:public"],
    exports = ["//inprocess"],
)

java_library(
    name = "internal",
    srcs = glob([
        "src/main/java/io/grpc/internal/*.java",
    ]),
    resources = glob([
        "src/bazel-internal/resources/**",
    ]),
    visibility = ["//:__subpackages__"],
    deps = [
        "//api",
        "//context",
        artifact("com.google.code.gson:gson"),
        artifact("com.google.android:annotations"),
        artifact("com.google.code.findbugs:jsr305"),
        artifact("com.google.errorprone:error_prone_annotations"),
        artifact("com.google.guava:guava"),
        artifact("io.perfmark:perfmark-api"),
        artifact("org.codehaus.mojo:animal-sniffer-annotations"),
    ],
)

java_library(
    name = "util",
    visibility = ["//visibility:public"],
    exports = ["//util"],
)

# Mirrors the dependencies included in the artifact on Maven Central for usage
# with maven_install's override_targets. Should only be used as a dep for
# pre-compiled binaries on Maven Central.
java_library(
    name = "core_maven",
    visibility = ["//visibility:public"],
    exports = [
        ":internal",
        "//api",
        "//util",
    ],
)
